package com.metrics.calculators;

import com.database.daos.ICountDao;
import com.database.objects.*;

public class MetricCounterElementsCalculator extends MetricCalculator {

	private static final long serialVersionUID = 3541315005020933063L;

	private ICountDao countDao;

	@Override
	public void calculate(Developer developer, String date, Type type, Status status, Contribution contribution) {
		Long value = countDao.getCountElementsByDeveloperAndDateAndTypeAndStatus(developer, date, type, status);
		contribution.setNumber(value.doubleValue());
	}

	public void setCountDao(ICountDao countDao) {
		this.countDao = countDao;
	}

}